<?php
/* SVN FILE: $Id: default.ctp 20 2009-05-02 13:50:00Z ake.svedin $ */
/**
 * Travian Alliance Coordinator
 * Copyright (c) 2009 Åke Svedin.
 *
 * This file is part of Travian Alliance Coordinator.
 *
 * Travian Alliance Coordinator is free software: you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Travian Alliance Coordinator is distributed in the hope that it will be
 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
 * Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * Travian Alliance Coordinator.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @author $Author: ake.svedin $
 * @copyright Copyright (c) 2009 Åke Svedin.
 * @version $Revision: 20 $
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3
 */
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $title_for_layout?></title>
<!--[if IE]>
<style type="text/css">
/* place css fixes for all versions of IE in this conditional comment */
.twoColHybLtHdr #sidebar1 { padding-top: 30px; }
.twoColHybLtHdr #mainContent { zoom: 1; padding-top: 15px; }
/* the above proprietary zoom property gives IE the hasLayout it may need to avoid several bugs */
</style>
<![endif]-->
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<!-- Include external files and scripts here (See HTML helper for more info.) -->
<?php echo $html->css('default.css'); ?>
<?php echo $scripts_for_layout ?>
</head>

<body class="twoColHybLtHdr">

<div id="container">
  <div id="header"><?php echo $html->image('logo.png', array('alt' => 'Travian Alliance Coordinator', 'width' => '325', 'height' => '100', 'align' => 'top'))?>
  </div><!-- end #header -->
  <div id="mbar_container">
  <div id="mbar">
  	<ul>
      <li<?php if(isset($Menu_active) && $Menu_active == 'start') { echo ' class="selected"'; } ?>><?php echo $html->link(__('Start', true), '/'); ?>
      <?php if(isset($Auth)): ?>
      <li<?php if(isset($Menu_active) && $Menu_active == 'profile') { echo ' class="selected"'; } ?>><?php echo $html->link(__('Profile', true), array('controller'=> 'users', 'action' => 'view', 'id' => $Auth['User']['id'], 'admin' => false)); ?>
      <li<?php if(isset($Menu_active) && $Menu_active == 'planner') { echo ' class="selected"'; } ?>><?php echo $html->link(__('Planner', true), array('controller'=> 'planner', 'action' => 'index', 'admin' => false)); ?></li>
      <li<?php if(isset($Menu_active) && $Menu_active == 'stats') { echo ' class="selected"'; } ?>><?php echo $html->link(__('Statistics', true), array('controller'=> 'stats', 'action' => 'index', 'admin' => false)); ?></li>
      <li<?php if(isset($Menu_active) && $Menu_active == 'admin') { echo ' class="selected"'; } ?>><?php echo $html->link(__('Administration', true), array('controller'=> 'users', 'action' => 'index', 'admin' => true)); ?>
      <?php endif ?>
    </ul>
      <br class="clearfloat" />
  </div><!-- end #mbar -->
  </div><!-- end #mbar_container -->
  <div id="header_divider">
	&nbsp;
  </div><!-- end #header_divider -->
  <div id="sidebar1">
    <?php if(isset($Menu_active) && $Menu_active != null) { echo $this->element($Menu_active); } ?>
    <p>
    <?php if(isset($Auth)): ?>
    <?php echo 'Logged in as ' . $Auth['User']['username'] . '<br />'; ?>
    <?php echo $html->link(__('Log out', true), array('controller'=> 'users', 'action'=>'logout')); ?>
    <?php endif ?>
    </p>
    <p class="copyright"><a href="http://travalco.googlecode.com/">TravALCO v0.1a<br />
    </a>&copy; 2009 &Aring;ke Svedin</p>
  </div><!-- end #sidebar1 -->
  <div id="mainContent">
    <?php if ($session->check('Message.auth')) $session->flash('auth'); ?>
    <?php if ($session->check('Message.flash')) $session->flash('flash'); ?>
    <?php echo $content_for_layout ?>
  </div><!-- end #mainContent -->
  <br class="clearfloat" />
</div><!-- end #container -->
</body>
</html>